package example;
import facecat.FaceCatScript;
import facecat.topin.btn.FCButton;
import facecat.topin.core.*;
import facecat.topin.input.*;
import facecat.topin.tab.FCTabPage;
import facecat.topin.xml.*;

/*
 * 日期选择示例
 */
public class SpinExample extends FCUIXml implements FCTouchEventCallBack
{
    /*
     * 加载Xml
     * @param fileName 文件名
     * @param view 视图名称
     */
    public void loadXml(String fileName, FCView view)
    {
        setScript(new FaceCatScript(this));
        super.loadXml(fileName, view);
        //获取第二页
        FCTabPage tabPage = getTabPage("TabPage2");
        FCSpin spin3 = new FCSpin();
        spin3.setLocation(new FCPoint(100, 100));
        spin3.setSize(new FCSize(100, 20));
        tabPage.addView(spin3);
        spin3.setValue(33);

        FCButton button1 = getButton("Button");
        button1.addEvent(this, FCEventID.Click, this);
    }

    /*
     * 点击事件
     * @param eventName 事件ID
     * @param sender 发送者
     * @param touchInfo 触摸信息
     * @param invoke 引用者
     */
    public void callTouchEvent(String eventName, Object sender, FCTouchInfo touchInfo, Object invoke)
    {
        FCSpin spin = getSpin("Spin");
        FCSpin spin2 = getSpin("Spin2");
        double value1 = spin.getValue();
        double value2 = spin2.getValue();
    }
}